Skip to content

Conversation

@kalessil
Copy link
Contributor

UTs: passed
Non-functional changes, micro-optimizations

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct addServer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably PhpStoms has incorrect definition in stubs, will revert this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. 1cb8f45

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@GromNaN
Copy link
Collaborator

GromNaN commented Jul 18, 2015

Replacing rand by mt_rand seems to be a good idea.

The mt_rand() function [...] will produce random numbers four times faster than what the average libc rand() provides.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this found automatically, I spent couple hours just fixing.

@kalessil
Copy link
Contributor Author

mt_* is basically new generation replacement. Hopefully I'll find time to write a PHP CS FIxer to automate this (like for is_null, alias functions, __DIR__ usage).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GromNaN
Copy link
Collaborator

GromNaN commented Jul 18, 2015

Thanks, that's awesome. All that micro-optimizations will be rewarding for all our apps.
I'm curious to know how you did that.

@kalessil
Copy link
Contributor Author

Static Code Analysis is my tool: https://plugins.jetbrains.com/plugin/7622 (you'll need PhpStorm for it).

And fixing done partially by those fixers:
PHP-CS-Fixer/PHP-CS-Fixer#1304
PHP-CS-Fixer/PHP-CS-Fixer#1302
PHP-CS-Fixer/PHP-CS-Fixer@d86a8aa

Quite lot of this is automated (not everything of course).

@kalessil
Copy link
Contributor Author

SCA Tool is advanced one, but most probably you'll want to adjust it for your needs.

Feel free to ask questions )

GromNaN added a commit that referenced this pull request Jul 18, 2015
Static Code Analysis with Php Inspections (EA Extended)
@GromNaN GromNaN merged commit c85e512 into FriendsOfSymfony1:master Jul 18, 2015
@GromNaN
Copy link
Collaborator

GromNaN commented Jul 18, 2015

Thanks @kalessil. I'll try it on my projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants